package cn.tedu.Writer;

import com.sun.corba.se.impl.orbutil.ObjectUtility;

import java.io.*;

/**
 * Date：2022年01月
 * Author：程Sir
 * Name： JavaSE-API
 * Content:
 *  字符输出流：OutputStreamWriter
 */
public class OSWDemo {
    public static void main(String[] args) throws IOException {
        // 创建字节流对象
        FileOutputStream fileOutputStream = new FileOutputStream("demo.txt");
        // 创建转换流: 字符-字节
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream,"utf-8");
        // 写出数据
        outputStreamWriter.write("为中华崛起而读书！");
        // 关闭流连接，释放系统资源
        outputStreamWriter.close();
    }


}
